package com.qiaofang.applet.service.member.repository;

import com.qiaofang.applet.service.member.domain.Employee;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author daiyuxiang
 */
@Repository
public interface EmployeeRepository extends MongoRepository<Employee, String> {

    Employee findByEmployeeUniqueUuidAndCompanyUuid(String employeeUniqueUuid, String companyUuid);

    List<Employee> findAllByEmployeeUniqueUuidInAndCorporationCode(List<String> employeeUniqueUuidList, String corporationCode);

    List<Employee> findAllByEmployeeUuidInAndCorporationCode(List<String> employeeUuidList, String corporationCode);

    Employee findByEmployeeUniqueUuid(String employeeUniqueUuid);

    Employee findByMarketingEmployeeUuid(String marketingEmployeeUuid);

    Employee findByCompanyUuidAndEmployeeUuid(String companyUuid, String employeeUuid);

    Employee findByCompanyUuidAndMarketingEmployeeUuid(String companyUuid, String marketingEmployeeUuid);

    List<Employee> findByCorporationCodeAndMobilePhone(String corporationCode, String mobilePhone);

    List<Employee> findAllByEmployeeUuidInAndCompanyUuid(List<String> uuidList, String companyUuid);

    List<Employee> findListByEmployeeUniqueUuidIn(List<String> employeeUniqueUuids);

    List<Employee> findAllByCompanyUuidAndMarketingEmployeeUuidIn(String companyUuid, List<String> marketingEmployeeUuid);
}
